package com.langsin.chenxinhao.mapper;

import com.langsin.bean.Goods;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface GoodsMapper {
    int addGoods(Goods goods);

    List<Goods> queryByName(String goodsName);

    List<Goods> queryByName2(String goodsName);

    int counts(String tableName);

    List<Goods> queryByIds(List<Integer> ids);

    // 注解形式
    /*@Select("select * from goods where goodsId = #{gid}")
    Goods queryByIdAno(@Param("gid") Integer id);*/
     @Select("select * from goods where goodsId = #{gid}")
    Goods queryByIdAno(Integer gid);

     /*多条件查询*/
    List<Goods> queryByCondition(Goods goods);

    /*多条件修改*/
    int updateByCondition(Goods goods);
}
